﻿@model IEnumerable<BlondeHeaven.UI.Models.Shop.RegisterShopViewModel>
@{
    ViewData["Title"] = "Index";
}

<h1>Web前端来写 下面显示是所有店铺的美化</h1>

<p>
    <a asp-action="Register">Create New</a>
</p>

<form asp-controller="shop" asp-action="Index">
    <p>
        搜索店铺: <input type="text" name="SearchString">
        <input type="submit" value="Filter" />
    </p>
</form>

<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Address)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Photo)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Phone)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Sales)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Name)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Address)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Photo)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Phone)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Sales)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.ActionLink("编辑", "Edit", new { Id = item.Id, UserId = item.UserId }) |
                    @Html.ActionLink("查看这个店铺", "Details", new { id = item.Id, userid = item.UserId }) |
                    @Html.ActionLink("删除店铺", "Delete", new { id = item.Id, userid = item.UserId })
                </td>
            </tr>
        }
    </tbody>
</table>
